<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>评论</title>
<link rel="stylesheet" type="text/css"
	href="/bootstrap/bootstrap.4.1.0.css">
<script src="/bootstrap/jquery.3.2.1.min.js"></script>
<script src="/bootstrap/popper.12.5.min.js"></script>
<script src="/bootstrap/bootstrap.4.1.0.min.js"></script>
<script src="/layui/layer/layer.js"></script>
<script type="text/javascript">
	$(function(){
		let oid = window.location.href.split("=")[1];
		$("#send").click(function(){
			var content = $("#content").val();
			var mark = $("input:radio:checked").val();
			var data = {
				"oid":oid,
				"content":content,
				"mark":mark
			}
			$.getJSON("/remark/addRemark",data,function(res){
				if(res.code==1){
					layer.msg("评论发表成功，页面即将跳转");
					setTimeout(function(){
						location.href = "/zlz/main.html";
					},3000)
					
				}else if(res.code==2){
					layer.msg("系统维护中，请稍后再试")
				}else if(res.code==3){
					layer.msg("您已评价过此单，请勿重复评论")
				}
			})
		})
		$("#clear").click(function(){
			$("#content").val("");
			$('input:radio:first').attr('checked', 'checked');
		})
	})
</script>
</head>
<body>
	<div class="container">
			<label>评价：</label>
			<label class="radio"><input type="radio" name="optradio" value="1" checked="checked">好评</label>
			<label class="radio"><input type="radio" name="optradio" value="2">中评</label>
			<label class="radio"><input type="radio" name="optradio" value="3">差评</label><br>
			<label>评价内容：</label><br>
		<div class="input-group mb-3">
			<input type="text" class="form-control" id="content">
			<div class="input-group-append">
				<button class="btn btn-primary" type="button" id="send">发表</button>
				<button class="btn btn-danger" type="button" id="clear">清空</button>
			</div>
		</div>
	</div>
</body>
</html>